package com.zhengqing.demo.controller;

import com.zhengqing.demo.model.vo.ApiRespVO;
import com.zhengqing.demo.service.IEasyExcelReadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;


/**
 * @author new
 */
@Slf4j
@RestController
@RequestMapping("/easyExcel/read")
@Api(tags = {"小主专用接口"})
public class BizController {

    @Resource
    private IEasyExcelReadService easyExcelReadService;

    @ApiOperation("乳腺彩超表格解析")
//    @ApiImplicitParam(name = "rxssFile", value = "乳腺手术表", required = true)
    @PostMapping(value = "rxcc")
    public ApiRespVO rxccReadAndExport(@RequestPart @RequestParam("乳腺彩超.xlsx") MultipartFile file) {
        return this.easyExcelReadService.rxccReadAndExport(file);
    }

    @ApiOperation("乳腺钼靶(mù bǎ)表格解析")
    @PostMapping(value = "rxmb")
    public ApiRespVO rxmbReadAndExport(@RequestPart @RequestParam("乳腺钼靶.xlsx") MultipartFile file) {
        return this.easyExcelReadService.rxmbReadAndExport(file);
    }

    @ApiOperation("乳腺手术和宫颈手术表格解析")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "rxssFile", value = "乳腺手术表", required = true),
//            @ApiImplicitParam(name = "zyrzFile", value = "住院日志表", required = true),
//            @ApiImplicitParam(name = "gjssFile", value = "宫颈手术表", required = true)
//    })
    @PostMapping(value = "rxss")
    public ApiRespVO rxssReadAndExport(@RequestPart @RequestParam("乳腺手术.xlsx") MultipartFile rxssFile,
                                       @RequestPart @RequestParam("住院日志.xlsx") MultipartFile zyrzFile,
                                       @RequestPart @RequestParam("宫颈手术.xlsx") MultipartFile gjssFile) {
        return this.easyExcelReadService.rxssReadAndExport(zyrzFile, rxssFile, gjssFile);
    }

    @ApiOperation("tct表格和hpv表格解析")
    @PostMapping(value = "tctAndHpv")
    public ApiRespVO tctAndHpvReadAndExport(@RequestPart @RequestParam("门诊日志.xlsx") MultipartFile mzrzFile,
                                            @RequestPart @RequestParam("tct.xlsx") MultipartFile tctFile,
                                            @RequestPart @RequestParam("hpv.xlsx") MultipartFile hpvFile) {
        return this.easyExcelReadService.tctAndHpvReadAndExport(mzrzFile, tctFile, hpvFile);
    }

    @ApiOperation("慢病管理门诊费用计算")
    @PostMapping(value = "mbglmzfyjs")
    public ApiRespVO mbglmzfyjs(@RequestPart @RequestParam("门诊日志.xlsx") MultipartFile mzrzFile,
                                @RequestPart @RequestParam("慢病管理门诊.xlsx") MultipartFile mbglmzFile) {
        return this.easyExcelReadService.mbglmzfyjs(mzrzFile, mbglmzFile);
    }

    @ApiOperation("慢病管理住院费用计算")
    @PostMapping(value = "mbglzyfyjs")
    public ApiRespVO mbglzyfyjs(@RequestPart @RequestParam("住院日志.xlsx") MultipartFile zyrzFile,
                                @RequestPart @RequestParam("慢病管理住院.xlsx") MultipartFile mbglzyFile) {
        return this.easyExcelReadService.mbglzyfyjs(zyrzFile, mbglzyFile);
    }

}
